#include "Pch.h"
#include "OpenGLContext.h"
#include "Engine\Log.h"
#include <glad\glad.h>
#include <GLFW\glfw3.h>

namespace Engine 
{
	OpenGLContext::OpenGLContext(GLFWwindow* windowHandle)
		: m_WindowHandle(windowHandle)
	{

	}

	void OpenGLContext::Init()
	{
		glfwMakeContextCurrent(m_WindowHandle);
		bool err = gladLoadGL() == 0;
		ASSERT(!err, "Failed to initialize OpenGL loader!");
	}

	void OpenGLContext::SwapBuffer()
	{
		glfwSwapBuffers(m_WindowHandle);
	}
}